package day20170417.ch01;

public class Animal {

	/**
	 * 宠物名字
	 */
	private String name;
	
	/**
	 * 宠物年龄
	 */
	private int age;
	
	/**
	 * 宠物颜色
	 */
	private String color;


	/**
	 * 构造方法
	 * @param name
	 */
	public Animal(String name) {
		super();
		this.name = name;
	}
	public Animal(String name, int age) {
		super();
		this.name = name;
		this.age = age;
	}
	public Animal(String name, int age, String color) {
		super();
		this.name = name;
		this.age = age;
		this.color = color;
	}
	/**
	 * set/get
	 * @return
	 */
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public int getAge() {
		return age;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
	
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	/**
	 * 重写toString
	 */
	@Override
	public String toString() {
		return "Animal [name=" + name + ", age=" + age + "]";
	}
}
